/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qdu.service.impl;

import com.qdu.dao.DianzanDao;
import com.qdu.dao.impl.DianzanDaoImpl;
import com.qdu.entity.Dianzan;
import com.qdu.service.DianzanService;

/**
 * 实现DianzanService接口定义的业务逻辑
 * @author Lenovo
 */
public class DianzanServiceImpl implements DianzanService{
    DianzanDao dianzanDao=new DianzanDaoImpl();
    
    @Override
    public boolean hasZan(String jid, int uid)
    {
        if(dianzanDao.hasLike(jid, uid))
            return false;
        return dianzanDao.addOneLike(jid, uid);
    }
    
    @Override
    public int addZan(String jid)
    {
        return dianzanDao.addLikeNum(jid);
    }
}
